﻿public static class Extension
{
    public static int ToInt(this string val, int fail_default){
        int convert_val;
        if (!int.TryParse(val, out convert_val))
            return fail_default;
        else
            return convert_val;
    }
}